package lovo.practice_7_14;

import lovo.Util.Util;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SavePanel extends JPanel implements ActionListener {
    private J189_7_14 frame;
    private JButton jButtonComfirm;
    private Icon ImageComfirm = Util.getimagesIcon("/Images/buttonSure.jpg");
    private Icon ImageSave = Util.getimagesIcon("/Images/buttonSave.jpg");
    public SavePanel(J189_7_14 frame) {
        this.frame = frame;
        this.setLayout(null);
        this.setOpaque(false);
        JLabel jLabelSave = new JLabel(ImageSave);
        jLabelSave.setBounds(200, 200, 140, 50);
        this.add(jLabelSave);

        JTextField jTextFieldSave = new JTextField();
        jTextFieldSave.setBounds(400, 200, 140, 50);
        this.add(jTextFieldSave);

        jButtonComfirm = new JButton( ImageComfirm);
        jButtonComfirm.setBounds(300, 600, 140, 50);
        this.add(jButtonComfirm);
        jButtonComfirm.addActionListener(this);

    }


    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == jButtonComfirm) {
            frame.switchPanel("mune");
        }
    }
}
